<template>
  <el-tabs type="card" v-model="activeName" @tab-click="handleClick">
    <el-tab-pane label="回款计划" name="1">
      <page1 ref="page1Ref" :dataInfo="dataInfo" :showItem="showItem" />
    </el-tab-pane>
    <el-tab-pane label="回款记录" name="2">
      <page2 ref="page2Ref" :dataInfo="dataInfo" :showItem="showItem" />
    </el-tab-pane>
  </el-tabs>
</template>
<script setup>
import page1 from "./tabDialog/tab6/Page1.vue";
import page2 from "./tabDialog/tab6/Page2.vue";
const props = defineProps({
  dataInfo: {
    type: Object,
    default: {},
  },
  customInfo: {
    type: Object,
    default: {},
  },
  showItem: {
    type: Boolean,
    default: false,
  },
});

let activeName = ref("1");
let page1Ref = ref(null);
let page2Ref = ref(null);
function handleClick(data) {
  console.log(data);
  let name = data.props.name
  if (name == "1") {
    page1Ref.value.initFun();
  } else {
    page2Ref.value.initFun();
  }
}
function initFun() {
  activeName.value = "1";
  nextTick(() => {
    page1Ref.value.initFun();
  });
}
defineExpose({
  initFun,
});

onMounted(() => { });
</script>

<style lang="scss" scoped></style>
